﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="ihg-sidemenu ihg-theme-draft" style="display: inline;">

  
    <c:forEach var="menu" items="${secure.sessionMenus}">
      <c:if test="${currentPrincipal.hasResource('sessionmenus', menu.id)}">
        <%-- <c:choose>
          <c:when test="${not empty menu.submenus}"> --%>
            <ul class="nav nav-stacked ihg-sidebar" role="tablist">
              <li class="presentation ${menuContext.shouldHighlight(menu.id) ? 'active' : ''}" role="presentation">
                <a href="javascript:void(0);" class="" style="display: block; padding-left: 33px;"> <span class="iconfont icon-lingxing" style="position: absolute; width: 16px; left: 10px; top: 6px; height: 22px;"></span><strong>${menu.name}</strong></a>
                <ul class="subnav list-unstyled">
                  <c:forEach var="submenu" items="${menu.submenus}">
                    <c:if test="${currentPrincipal.hasResource('sessionmenus', submenu.id)}">
                      <c:choose>
                        <c:when test="${not empty submenu.submenus}">
                          <li class="presentation" role="preparation"><a href="${param.currentUrl}/${submenu.url}" class=""><span class="caret"></span>${submenu.name}</a>
                            <ul class="subnav list-unstyled">
                              <c:forEach var="ssmenu" items="${submenu.submenus}">
                                <li class="${menuContext.shouldHighlight(ssmenu.id) ? 'active' : ''}"><a href="${param.currentUrl}/${ssmenu.url}" title="${ssmenu.description}">${ssmenu.name}</a></li>
                              </c:forEach>
                            </ul></li>
                        </c:when>
                        <c:otherwise>
                          <li class="${menuContext.shouldHighlight(submenu.id) ? 'active' : ''}"><a href="${param.currentUrl}/${submenu.url}" title="${submenu.description}">${submenu.name}</a></li>
                        </c:otherwise>
                      </c:choose>
                    </c:if>
                  </c:forEach>
                </ul>
              </li>
            </ul>
          <%-- </c:when>
          <c:otherwise>
            <ul class="nav nav-stacked ihg-sidebar subnav" role="tablist">
                <li class="${menuContext.shouldHighlight(menu.id) ? 'active' : ''}">
                  <a style="padding-top: 0px; padding-bottom: 0px; background-color: transparent;" href="${param.currentUrl}/${menu.url}" title="${menu.description}">${menu.name}</a>
                </li>
            </ul>
          </c:otherwise>
        </c:choose> --%>
      </c:if>
    </c:forEach>
  
</div>

